import {BaseUrl} from "../constant/constant";
import {ApiFetch} from "../api/apiHandler";

// /setselectiondefaultvalue //
// type SetSelectionDefaultValueJson struct {
//     Total      int64         `binding:"min=100"` //要分配的评选数
//     Allocation []WeightValue `binding:"min=1"`
// }
//
// type WeightValue struct {
//     Id     int64 //球员id
//     Weight int64 //权重,总权重100
// }

class VoteModel {
    constructor() {
        this.url = BaseUrl
    }

    all(params) {
        let end = this.url + 'getselection'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    delete(params) {
        let end = this.url + 'delselection'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    addGrade(params) {
        let end = this.url + 'addselection1'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    addLineUp(params) {
        let end = this.url + 'addselection2'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    addForecast(params) {
        let end = this.url + 'addselection3'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }

    result(params) {
        let end = this.url + 'getselectionresult'
        let req = new ApiFetch(end)
        return req.fetch(params)
    }
}

export default VoteModel